//
//  KaiJiangHistoryViewController.m
//  新项目
//
//  Created by liGordon on 17/4/1.
//  Copyright © 2017年 刘耀宗. All rights reserved.
//

#import "KaiJiangHistoryViewController.h"
#import "KaiJiangFiveHistoryCell.h"
#import "KaiJiangSevenHistoryCell.h"
#import "KaiJiangThreeHistoryCell.h"
static NSString *identifier1 = @"KaiJiangThreeHistoryCell";
static NSString *identifier2 = @"KaiJiangFiveHistoryCell";
static NSString *identifier3 = @"KaiJiangSevenHistoryCell";
@interface KaiJiangHistoryViewController ()<UITableViewDelegate,UITableViewDataSource>
@property (weak, nonatomic) IBOutlet UITableView *menuTable;
@end

@implementation KaiJiangHistoryViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    _menuTable.delegate = self;
    _menuTable.dataSource = self;
    [_menuTable registerNib:[UINib nibWithNibName:@"KaiJiangSevenHistoryCell" bundle:nil] forCellReuseIdentifier:identifier3];
    [_menuTable registerNib:[UINib nibWithNibName:@"KaiJiangFiveHistoryCell" bundle:nil] forCellReuseIdentifier:identifier2];
    [_menuTable registerNib:[UINib nibWithNibName:@"KaiJiangThreeHistoryCell" bundle:nil] forCellReuseIdentifier:identifier1];

}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 20;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    [tableView deselectRowAtIndexPath:indexPath animated:YES];// 取消选中
    //其他代码
}


-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 85;
}


-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (self.flag == 5) {
        KaiJiangFiveHistoryCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier2];
        cell.numArr = self.numArr;
        return cell;

    }else if (self.flag == 7){
        KaiJiangSevenHistoryCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier3];
        return cell;
    }else if (self.flag == 3){
        KaiJiangThreeHistoryCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier1];
        return cell;
    }else{
        return nil;
    }
}

@end
